package org.zebra.trans;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.zebra.trans.core.DefaultDictTranslation;
import org.zebra.trans.core.Translation;
import org.zebra.trans.core.handler.TranslationHandler;

import java.lang.annotation.*;

/**
 * 翻译注解
 *
 * @author zhanghongbin
 */
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@Documented
@JacksonAnnotationsInside
@JsonSerialize(using = TranslationHandler.class)
public @interface Trans {

    Class<? extends Translation> translationClass() default DefaultDictTranslation.class;

    String alias() default "";

    // (如: 0=男,1=女,2=未知)
    String readConverterExp() default "";

    /**
     * @return true false
     */
    boolean isFlat() default false;
}
